package main

import (
	"encoding/json"
	"fmt"
)

//为结构体打标签，方便前后台数据同步
type tag_struct struct {
	Name string `json:"name"`
	Age int `json:"age"`
	Skill  string `json:"skill"`
}

func main() {
	tagStruct :=  tag_struct{
		Name:"hello",
		Age : 12,
		Skill:"learn",
	}
	jsonStr, err := json.Marshal(tagStruct)
	if err != nil{
		fmt.Println("error")
	}else{
		fmt.Println(string(jsonStr))
	}
}